SELF Join
The SELF JOIN command, used to join the same table with it's own based on the queries.
For Example:
Let's use locations table for this query. Refer Introduction to know about this table and the database.

Let's do query to find what are all the street_address are from what country_id.
SELECT A.street_address AS street_address_1, B.street_address AS street_address_2, A.country_id FROM locations A, locations B WHERE A.street_address <> B.street_address AND A.country_id = B.country_id;
Here, i am fetching street_address_1, street_address_2 from locations_1, locations_2. In where condition, i am saying street_address should not match and country_id should match. So it will look for street_address whose country_id are same and will return.
Result:
